1. Technical Field
The present invention relates to a power supply switching circuit, a real time clock device, an electronic apparatus, a mobile unit, and a method of controlling the power supply switching circuit.
2. Related Art
A real time clock (RTC) circuit is a circuit having a timing function and incorporated in various electronic apparatuses such as a personal computer. Generally, the RTC circuit is required to continue timing even when a main power supply of the electronic apparatus is turned off or main power is not supplied temporarily due to instantaneous power interruption, and a power supply switching circuit for detecting shutdown of the main power supply and switching the power supply of the RTC circuit to a backup power supply is provided. As the backup power supply, a primary cell, a secondary cell, a high-capacity capacitor, or the like is used depending on the intended use. In the case where the secondary cell or the high-capacity capacitor is used as the backup power supply, the power supply switching circuit supplies main power to the RTC circuit and flows a current from the main power supply to the backup power supply for charging the backup power supply at the same time. For example, Patent Document 1 (JP-A-2009-188862) discloses a backup power supply circuit for switching the power supply of the RTC circuit using a secondary cell as a backup power supply. FIG. 15 is a configuration diagram of the backup power supply circuit described in Patent Document 1. A first voltage detection circuit VD1 detects a voltage of a main power supply terminal Vcc and, if the detected voltage is equal to or more than a first detection voltage, brings a first switch SW1 into connection (conduction). A second voltage detection circuit VD2 detects the voltage of the main power supply terminal Vcc and, if the detected voltage is equal to or more than a second detection voltage, brings a second switch SW2 to open (out of conduction). In short, the first switch SW1 is provided for switching the power supply of the RTC circuit to the backup power supply when the voltage of the main power supply is lower, and the second switch SW2 is provided for preventing overcharge of the backup power supply. According to the circuit having the above described configuration, normally, the main power may be supplied to the RTC circuit while the backup power supply is charged without overcharge, and, if the main power supply is shut down, a current flows from the main power supply terminal Vcc via a load circuit to the ground and the voltage of the main power supply terminal VCC is lower, and the first switch SW1 is opened and the power supply of the RTC circuit may be switched to the backup power supply.
However, in the circuit configuration described in Patent Document 1, in the case where the load of the load circuit is lighter, when the main power supply is shut down, a current flowing out from the main power supply terminal Vcc via the load circuit to the ground and a current flowing from the backup power supply into the main power supply terminal Vcc may be balanced and, as a result, the voltage of the main power supply terminal Vcc does not become lower and the first switch SW1 remains connected, and a problem that the charge accumulated in the backup power supply is wastefully consumed or an unstable condition that a control CPU is not completely turned off is caused arises. By increasing a resistance value of a protective resistor, the balance between the current flowing out from the main power supply terminal Vcc via the load circuit to the ground and the current flowing from the backup power supply into the main power supply terminal Vcc may be lost and discharge may be easier, however, the charging time of the backup power supply becomes longer.